package cn.dw.web.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(name="AccessTokenServlet")
public class AccessTokenServlet
  extends HttpServlet
{
  private static final long serialVersionUID = 6412324322404315071L;
  
  public void init()
    throws ServletException
  {
    TokenThread.setAppId(getInitParameter("appid"));
    TokenThread.setAppSecret(getInitParameter("appsecret"));
    System.out.println("appid:" + TokenThread.appId);
    System.out.println("appSecret:" + TokenThread.appSecret);
    new Thread(new TokenThread()).start();
  }
  
  public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
  {
    request.getParameter("");
  }
  
  public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
  {}
}
